import { createStore } from 'redux'

// reducer 是修改state的唯一方式
const reducer = (initState, action) => {
    if (action.type === 'changeStoreTitle') {
        return {
            ...initState,
            storeTitle: action.title
        }
    }

    return initState
}

const initState = {
    storeTitle: '上海网站'
}

const store = createStore(reducer, initState)

export default store